package net.wexoo.onlinedivelog.entity.diver;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import net.wexoo.onlinedivelog.entity.person.PersonBean;

/**
 * @author wexoo
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@Entity
@Table(name = "DIVER")
@PrimaryKeyJoinColumn(name = "PERSON")
public class DiverBean extends PersonBean {

	private static final long serialVersionUID = 1L;

	@Column(name = "DIVER_SINCE")
	private Date diverSince;
	@Column(name = "FAVORITE_DIVE_SITE")
	private String favoriteDiveSite;

	public DiverBean(PersonBean personBean) {
		super(personBean.getDiveLevel(), personBean.getLogin(), personBean.getPassword(), personBean.getForename(),
				personBean.getSurname(), personBean.getEmail());
	}
}
